
class A {
    int a;
    int b;
    String name;
    public void eat(){
        System.out.println("在吃饭");
    }

    public void sleep(){
        System.out.println("在睡觉");
    }
}

class B extends A{
    public void play(){
        System.out.println("在玩游戏");
    }

    @Override
    public void eat() {
        System.out.println(this.name + "吃火锅");
    }

    @Override
    public void sleep() {
        System.out.println(this.name + "在睡觉");
    }

}


class C{
    int a;
    String name;

    public C(int a, String name) {
        this.a = a;
        this.name = name;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "C{" +
                "a=" + a +
                ", name='" + name + '\'' +
                '}';
    }
}

public class Test {
    public static void main(String[] args) {
        /*int a = 10;
        System.out.println(a);
        System.out.println("hello world");*/

        A a = new A();
        a.sleep();
        a.eat();
        B b = new B();
        b.play();
        a.name = "lyx";
        A a1 = new B();
        a1.name = a.name;
        a1.eat();
        a1.sleep();
        a.sleep();

        C c = new C(10,"lyx");
        c.setName("cw");
        System.out.println(c);
    }

}
